#include "string_utils.h"
#include <cstring>
#include <algorithm>

char* reverse_string(const char* str) {
    size_t len = strlen(str);
    char* reversed = new char[len + 1];
    std::copy(str, str + len, reversed);
    std::reverse(reversed, reversed + len);
    reversed[len] = '\0';
    return reversed;
}

size_t string_length(const char* str) {
    return strlen(str);
}

void free_string(char* str) {
    delete[] str;
}